package org.imlinker.status;

import java.awt.Component;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

import org.imlinker.gui.StatusDialog.ListItem;

/**
 * 用来显示状态修改对话框中的状态选择下来对话框.
 */

@SuppressWarnings("serial")
public class StatusCellRenderer extends DefaultListCellRenderer {

	public final Component getListCellRendererComponent(final JList list,
			final Object value, final int index, final boolean iss,
			final boolean chf) {
		super.getListCellRendererComponent(list, value, index, iss, chf);

		ListItem item = (ListItem) value;

		setIcon(item.getIcon());
		setText(item.getTitle());

		return this;
	}
}
